<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>...</title>
		<link rel="stylesheet" href="../../css/base.css" />
		<script type="text/javascript" src="../../js/base.js" ></script>
		<script type="text/javascript" src="../../js/jquery-3.3.1.js" ></script>
		<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
	</head>
	<body>
		<div class="defHint">正在加载,请稍后..</div>
	</body>
	<script>
		
		var sparams = location.search.replace(/___/g,"&")

		// 缓存微信缤纷生活code
		localStorage.wechatPayCode=getUrlParam(sparams).code;
		localStorage.mchKey=getUrlParam(sparams).mchkey;
		
		isWeixin();

		// 小程序携带数据
		localStorage.orderNo=getUrlParam(sparams).orderNo||"";
		localStorage.currentPrice=getUrlParam(sparams).currentPrice||"";
		localStorage.activeType=getUrlParam(sparams).activeType||"";
		localStorage.payType=getUrlParam(sparams).payType||"";
		// 判断堂食或外卖
		if(localStorage.orderNo){
			localStorage.memTransType="TAKEOUT";
		} else {
			localStorage.memTransType="DINNING";
		}
		
		if(localStorage.wechatPayCode){
			// 获取微信健康生活code
			var appid="wxbb1234ec8b5dd78b";
			// var appid="wx9e52f48e27806808";
//			var httpUrl="https://cdadmin.landdt.cn/h5/pay/pages/microMessenger_pay/code_mch.html";		
			var httpUrl="https://cdadmin.landdt.cn/h5/pay/pages/microMessenger_pay/mch.html";		
			let url="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appid+"&redirect_uri="+httpUrl+"&response_type=code&scope=snsapi_userinfo&state&connect_redirect=1#wechat_redirect";			
			location.replace(url);
		} else {
			hint("未获取到用户code");
		}
	</script>
</html>